<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use EloquentFilter\Filterable;
use App\Models\Traits\Admin\ActionButtonTrait;

class Mainborad extends Model
{
    use Filterable, ActionButtonTrait;

    protected $append = ['actionButton'];
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    
    protected $actions = ['edit','delete'];


    protected $actionUri = 'mainborads';

    protected $fillable = [
        'name', 'freight_num','version','description'
    ];

    //配置
    public function config()
    {
        return $this->hasMany(MainboradSetting::class, 'mainborad_id', 'id');
    }
    //货道模板
    public function freightWayDemo()
    {
        return $this->hasMany(FreightWayDemo::class, 'mainborad_id', 'id');
    }
}
